#include "Arduino.h"

typedef void (*pin_callback)(uint8_t p ,uint8_t v);

//typedef void (*button_callback)();


typedef enum { fanOn, fanOff, fanAuto 
}  fanMode_t;

class Fan
{
	public:
		Fan(byte Pin, int MemLoc, pin_callback cb);
		void setMode(  fanMode_t mode  );
		fanMode_t getMode();
		void setOnTemp ( byte tmp );
		byte getOnTemp();
		void toggleState( boolean state );
		boolean getState();
		void begin();
		void save();


	private:
		
		boolean st;
		fanMode_t fanMode;
		int memLoc;
		byte temp;
		byte pin;
		pin_callback pinCtrl;
};